import { token_IListService } from '../services/token';
import { _createConditionalRootRenderer } from '@angular/platform-browser/src/dom/debug/ng_probe';
import { ListService } from '../services/ListServcie';
import { IListService } from '../services/IListService';
import { NgIf } from '@angular/common/src/directives/ng_if';
import { NgFor } from '@angular/common/src/directives/ng_for';
import { Component, Inject, Injector } from '@angular/core';

@Component({
    selector: 'list',
    template: `
         <div class="moon" *ngFor="let item of data">{{item.text}}<div>
    `,
    styles: [
        `.moon{
            font-size:17px;
        };`
    ],
    providers:  [],
})
export class List {
    data: Array<any> = [
        { text: '我是老大' },
        { text: '我是老大' },
        { text: '我是老大' }
    ];
    constructor(
        @Inject(token_IListService)
        servive: IListService
        ) {
        console.log(servive);
        console.log(typeof servive)
        this.data=this.data.concat(servive.getList());
    }
}